]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Disable naked Super keybinding if sticky
authorMatthias Clasen <mclasen@redhat.com>
Wed, 17 Apr 2013 23:59:02 +0000 (19:59 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 19 Apr 2013 14:25:28 +0000 (10:25 -0400)
With sticky keys, users should be able to press and release a
modifier and then press a key to activate a modifier-key combination.
Activating the overview on the Super key release keeps these
users from using keyboard shortcuts involving the Super modifier.

The solution implemented here is to simply disable the Super-release
binding if sticky keys are enabled. It is still possible to go
to the overview by using Super-S or Alt-F1.
https://bugzilla.gnome.org/show_bug.cgi?id=685974

js/ui/main.js

index f438114148aebef393d7a01f4f54507666718614..7232deb8be260f02a6e4f5fcf848a396157cb0db 100644 (file)
@@ -41,6 +41,9 @@ const Util = imports.misc.util;
 const OVERRIDES_SCHEMA = 'org.gnome.shell.overrides';
 const DEFAULT_BACKGROUND_COLOR = Clutter.Color.from_pixel(0x2e3436ff);
 
+const A11Y_SCHEMA = 'org.gnome.desktop.a11y.keyboard';
+const STICKY_KEYS_ENABLE = 'stickykeys-enable';
+
 let componentManager = null;
 let panel = null;
 let overview = null;
@@ -69,6 +72,7 @@ let _startDate;
 let _defaultCssStylesheet = null;
 let _cssStylesheet = null;
 let _overridesSettings = null;
+let _a11ySettings = null;
 
 function _sessionUpdated() {
     _loadDefaultStylesheet();
@@ -157,9 +161,14 @@ function _initializeUI() {
     layoutManager.init();
     overview.init();
 
+    _a11ySettings = new Gio.Settings({ schema: A11Y_SCHEMA });
+
     global.screen.override_workspace_layout(Meta.ScreenCorner.TOPLEFT,
                                             false, -1, 1);
-    global.display.connect('overlay-key', Lang.bind(overview, overview.toggle));
+    global.display.connect('overlay-key', Lang.bind(overview, function () {
+        if (!_a11ySettings.get_boolean (STICKY_KEYS_ENABLE))
+            overview.toggle();
+    }));
 
     // Provide the bus object for gnome-session to
     // initiate logouts.